package org.mogu.control.util;


import org.mogu.ContactListActivity;
import org.mogu.R;
import org.mogu.adapter.FriendExpandableListAdapter;
import org.mogu.control.model.IMUser;

import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.TextView;

	public class FriendExpandableChildClickListener  
		implements ExpandableListView.OnChildClickListener{

		private ContactListActivity mContext = null;
		
		
		public FriendExpandableChildClickListener(ContactListActivity paramActivity){
			mContext = paramActivity;
		}

		public boolean onChildClick(ExpandableListView parent, View v,
				int groupPosition, int childPosition, long id){
		    	//boolean bool = ContactListActivity.a(this.a, paramView, paramInt1, paramInt2);
		    	System.out.println("onChildClick");
		    	
		    	FriendExpandableListAdapter mFriendExpandableListAdapter = (FriendExpandableListAdapter)parent.getExpandableListAdapter();
		    	IMUser iMUser = (IMUser)mFriendExpandableListAdapter.getChild(groupPosition, childPosition);
		    	iMUser.setCount(0);
		    	TextView name = (TextView)v.findViewById(R.id.name);
				name.setText(iMUser.getUnicename());
		    	//TreeNode childTreeNode = (TreeNode)childV.get(childPosition);
		    	Bundle bundle = new Bundle();
		    	bundle.putSerializable("iMUser", iMUser);
		    	mContext.onChildClick(bundle);
		    	
		    	return true;
		}

	}